<?php
/**
 * Created by PhpStorm.
 * User: 烬萌丶
 * Date: 2021/9/5
 * Time: 18:53
 */
$TaskId = $_GET['TaskId'] ?? '';
$TaskStatus = $_GET['TaskStatus'] ?? '';

// 从数据库删除 $classId 的班级
$dsn = "sqlsrv:Server=LAPTOP-GQ4AGRUA\SQLEXPRESS;Database=Task";
$db = new PDO($dsn, "sa", "123456");

$sql = "update Task set TaskStatus=2 where TaskId='{$TaskId}'";
$result = $db->exec($sql);

if ($result) {
    echo '标记成功，前往<a href="list.php">列表页</a>';
} else {
    echo '标记失败';
}